<script setup>

const count = ref(0);
const loading = ref(false);
const onRefresh = () => {
    setTimeout(() => {
        showToast('刷新成功');
        loading.value = false;
        count.value++;
    }, 1000);
};

const value = ref(1);


onMounted(() => {
    value.value = 2;
    console.log(value.value);
});
</script>
<template>
    <div class="flex column">
        <van-pull-refresh v-model="loading" @refresh="onRefresh">
            <van-button type="primary">主要按钮</van-button>
            <van-button type="success">成功按钮</van-button>
            <van-button type="danger">危险按钮</van-button>
            <van-button type="warning">警告按钮</van-button>
            <van-button plain type="primary">朴素按钮</van-button>
            <van-button plain type="success">朴素按钮</van-button>
            <p>刷新次数: {{ count }}</p>
        </van-pull-refresh>
    </div>
</template>
<style>
.my-swipe .van-swipe-item {
    color: #fff;
    font-size: 20px;
    line-height: 150px;
    text-align: center;
    background-color: #39a9ed;
  }
.my-swipe .dif {
  background-color: #ccdba3;
}
</style>

